package day06;

import java.util.Scanner;

public class HW4 {
    /*请编写⼀个Java程序，实现从键盘录⼊⽉份，判断该⽉份属于哪个季节，
【要求】 
如果⽉份不再1-12之间，则报错：输⼊⽉份有误
匹配⽉份，输出对应的季节 12-2冬 3-5春 6-8夏 9-11秋  */
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入月份: ");
        int month = scanner.nextInt();
        String season;
        switch (month) {
            case 3:
            case 4:
            case 5:
                season = "春季";
                break;
            case 6:
            case 7:
            case 8:
                season = "夏季";
                break;
            case 9:
            case 10:
            case 11:
                season = "秋季";
                break;
            case 12:
            case 1:
            case 2:
                season = "冬季";
                break;
            default:
                season = "输入的月份无效";
        }
        System.out.println(season);
        scanner.close();
    }
}

